package com.testing.class13;

import com.testing.DriverSelf.HttpDriver;
import com.testing.common.AutoTools;

/**
 * @Classname HttpDriverTest
 * @Description 类型说明
 * @Date 2022/11/2 22:05
 * @Created by 特斯汀Roy
 */
public class HttpDriverTest {
    public static void main(String[] args) {
        AutoTools.saveParam("电商域名","http://www.testingedu.com.cn:8000/index.php");
        HttpDriver driver=new HttpDriver();
        String getIp = driver.doGet("https://sp1.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=3.3.3.3&co=&resource_id=5809");
        System.out.println(getIp);
        System.out.println("电商登录的返回是："+driver.doPostUrl(AutoTools.useParam("{电商域名}?m=Home&c=User&a=do_login&t=0.8568421812495208") , "username=13800138006&password=123456&verify_code=1"));

        String json = driver.doPost("http://www.testingedu.com.cn/mypro/api/user/login", "{\"username\":\"roy\",\"pwd\":\"123456\"}", "json");
        System.out.println("json登录的返回是"+json);
        String uploadResult = driver.doPostFile(  AutoTools.useParam("{电商域名}/home/Uploadify/imageUp/savepath/head_pic/pictitle/banner/dir/images.html") , "{\"text\":{\"id\":\"WU_FILE_0\",\"NAME\":\"悠米微信 .png\"},\"file\":{\"file\":\"E:\\\\QSwork\\\\素材\\\\悠米微信 .png\"}}");
        System.out.println("文件上传的返回是"+uploadResult);

    }
}
